<!DOCTYPE html>
<html lang="zh-CN" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>简介 | 小盐菌</title>
    <meta name="description" content="包含前端常用知识、源码阅读笔记、各种奇淫技巧、日常提效工具等">
    <link rel="preload stylesheet" href="/vitepress_note_public/assets/style.0e0c5bf7.css" as="style">
    
    <script type="module" src="/vitepress_note_public/assets/app.96a98344.js"></script>
    <link rel="preload" href="/vitepress_note_public/assets/inter-roman-latin.2ed14f66.woff2" as="font" type="font/woff2" crossorigin="">
    <link rel="modulepreload" href="/vitepress_note_public/assets/chunks/framework.521289a5.js">
    <link rel="modulepreload" href="/vitepress_note_public/assets/chunks/theme.0e4abe87.js">
    <link rel="modulepreload" href="/vitepress_note_public/assets/daily-notes_字符串.md.2d5c7bf1.lean.js">
    <meta name="theme-color" content="#3eaf7c">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon" href="/favicon.ico">
    <link rel="mask-icon" href="/favicon.ico" color="#3eaf7c">
    <meta name="msapplication-TileImage" content="/favicon.ico">
    <meta name="msapplication-TileColor" content="#000000">
    <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
    <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-9318537a><!--[--><!--]--><!--[--><span tabindex="-1" data-v-ed1ac132></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-ed1ac132> Skip to content </a><!--]--><!----><header class="VPNav" data-v-9318537a data-v-8f624d97><div class="VPNavBar" data-v-8f624d97 data-v-ff5c4dd3><div class="container" data-v-ff5c4dd3><div class="title" data-v-ff5c4dd3><div class="VPNavBarTitle" data-v-ff5c4dd3 data-v-3833bba8><a class="title" href="/vitepress_note_public/" data-v-3833bba8><!--[--><!--]--><!--[--><img class="VPImage logo" src="/vitepress_note_public/logo.png" alt data-v-27d32eb7><!--]--><!--[-->小盐菌<!--]--><!--[--><!--]--></a></div></div><div class="content" data-v-ff5c4dd3><div class="curtain" data-v-ff5c4dd3></div><div class="content-body" data-v-ff5c4dd3><!--[--><!--]--><div class="VPNavBarSearch search" data-v-ff5c4dd3><!----></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-ff5c4dd3 data-v-28080106><span id="main-nav-aria-label" class="visually-hidden" data-v-28080106>Main Navigation</span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/vitepress_note_public/" tabindex="0" data-v-28080106 data-v-7a34f57c><!--[--><span data-v-7a34f57c>首页</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/vitepress_note_public/nav/" tabindex="0" data-v-28080106 data-v-7a34f57c><!--[--><span data-v-7a34f57c>待开发</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://notes.fe-mm.com" target="_blank" rel="noreferrer" tabindex="0" data-v-28080106 data-v-7a34f57c><!--[--><span data-v-7a34f57c>待开发</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://netease-music.fe-mm.com" target="_blank" rel="noreferrer" tabindex="0" data-v-28080106 data-v-7a34f57c><!--[--><span data-v-7a34f57c>待开发</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://github.com/maomao1996/tampermonkey-scripts" target="_blank" rel="noreferrer" tabindex="0" data-v-28080106 data-v-7a34f57c><!--[--><span data-v-7a34f57c>待开发</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-ff5c4dd3 data-v-1962e285><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="toggle dark mode" aria-checked="false" data-v-1962e285 data-v-799bb6cc data-v-73f5360c><span class="check" data-v-73f5360c><span class="icon" data-v-73f5360c><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-799bb6cc><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-799bb6cc><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-ff5c4dd3 data-v-cf8658e3 data-v-630d9035><!--[--><a class="VPSocialLink no-icon" href="https://github.com/maomao1996/vitepress-nav-template" aria-label="github" target="_blank" rel="noopener" data-v-630d9035 data-v-516a33a1><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><a class="VPSocialLink no-icon" href="https://weixin.qq.com/" aria-label target="_blank" rel="noopener" data-v-630d9035 data-v-516a33a1><svg t="1703841371820" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7872" width="200" height="200"><path d="M683.058 364.695c11 0 22 1.016 32.943 1.976C686.564 230.064 538.896 128 370.681 128c-188.104 0.66-342.237 127.793-342.237 289.226 0 93.068 51.379 169.827 136.725 229.256L130.72 748.43l119.796-59.368c42.918 8.395 77.37 16.79 119.742 16.79 11 0 21.46-0.48 31.914-1.442a259.168 259.168 0 0 1-10.455-71.358c0.485-148.002 128.744-268.297 291.403-268.297l-0.06-0.06z m-184.113-91.992c25.99 0 42.913 16.79 42.913 42.575 0 25.188-16.923 42.579-42.913 42.579-25.45 0-51.38-16.85-51.38-42.58 0-25.784 25.93-42.574 51.38-42.574z m-239.544 85.154c-25.384 0-51.374-16.85-51.374-42.58 0-25.784 25.99-42.574 51.374-42.574 25.45 0 42.918 16.79 42.918 42.575 0 25.188-16.924 42.579-42.918 42.579z m736.155 271.655c0-135.647-136.725-246.527-290.983-246.527-162.655 0-290.918 110.88-290.918 246.527 0 136.128 128.263 246.587 290.918 246.587 33.972 0 68.423-8.395 102.818-16.85l93.809 50.973-25.93-84.677c68.907-51.93 120.286-119.815 120.286-196.033z m-385.275-42.58c-16.923 0-34.452-16.79-34.452-34.179 0-16.79 17.529-34.18 34.452-34.18 25.99 0 42.918 16.85 42.918 34.18 0 17.39-16.928 34.18-42.918 34.18z m188.165 0c-16.984 0-33.972-16.79-33.972-34.179 0-16.79 16.927-34.18 33.972-34.18 25.93 0 42.913 16.85 42.913 34.18 0 17.39-16.983 34.18-42.913 34.18z" fill="#09BB07" p-id="7873"></path></svg></a><a class="VPSocialLink no-icon" href="https://gitee.com/" aria-label target="_blank" rel="noopener" data-v-630d9035 data-v-516a33a1><svg t="1703841714246" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9766" width="200" height="200"><path d="M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z" fill="#C71D23" p-id="9767"></path></svg></a><a class="VPSocialLink no-icon" href="https://www.bilibili.com/" aria-label target="_blank" rel="noopener" data-v-630d9035 data-v-516a33a1><svg t="1703842691600" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10969" width="200" height="200"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#FF6B9B" p-id="10970"></path><path d="M336.896 115.584l117.568 115.968h115.008l117.632-115.904a36.672 36.672 0 0 1 51.328 0 35.456 35.456 0 0 1 0 50.56L672 231.552h75.648c33.664 0 65.92 13.184 89.792 36.672 23.808 23.488 37.12 55.296 37.12 88.512v286.08c0 33.216-13.312 65.024-37.12 88.512a127.872 127.872 0 0 1-89.792 36.672H276.288c-33.664 0-65.92-13.184-89.792-36.672a124.288 124.288 0 0 1-37.12-88.512v-286.08c0-33.216 13.312-65.024 37.12-88.512a127.872 127.872 0 0 1 89.792-36.672h75.584L285.568 166.144a35.456 35.456 0 0 1-9.344-34.56 36.608 36.608 0 0 1 60.736-16z m410.88 187.52H276.224a54.144 54.144 0 0 0-54.144 48.512l-0.256 5.12v286.08c0 27.648 21.248 50.752 49.152 53.44l5.248 0.192h471.424a54.144 54.144 0 0 0 54.144-48.448l0.256-5.12v-286.08a54.016 54.016 0 0 0-54.4-53.76z m-380.8 107.264c19.968 0 36.224 16 36.224 35.776v71.552a36.032 36.032 0 0 1-36.288 35.712 36.032 36.032 0 0 1-36.224-35.712V446.08c0-19.776 16.192-35.776 36.224-35.776z m290.112 0c20.032 0 36.224 16 36.224 35.776v71.552a36.032 36.032 0 0 1-36.224 35.712 36.032 36.032 0 0 1-36.288-35.712V446.08c0-19.776 16.256-35.776 36.288-35.776z" fill="#FF7BA6" p-id="10971"></path><path d="M741.632 390.72c2.496 0.448 22.208-3.968 23.04-2.56 1.28 1.92 10.048 65.152 7.68 65.6-2.24 0.384-18.56 4.16-18.56 4.16-1.28-8.576-11.968-61.76-12.16-67.2m31.36-6.08l8.64 68.032c4.352-0.192 22.144-1.472 23.872-1.664-2.56-25.728-6.912-66.368-6.912-66.368a65.536 65.536 0 0 0-25.6 0m-16.896 94.464s38.72-9.856 52.736-5.056c7.104 25.728 20.096 170.24 21.376 176.064-8.832 1.088-37.76 3.584-40 4.224-1.92-10.88-34.112-168.32-34.112-175.232m143.36-86.72c2.368 0.64 22.848-2.112 23.04-0.64 0.448 5.056 2.56 65.792 0.256 65.92l-18.688 1.728c-0.384-8.32-4.992-61.376-4.544-67.008m31.616-1.664l1.664 67.2c4.352 0 21.952 1.024 23.872 0.832-0.448-25.728 0-66.368 0-66.368a115.712 115.712 0 0 0-25.6-1.664m-27.008 90.24s39.616-5.248 52.992 1.024c2.944 30.144 2.56 170.688 2.944 176.512-8.96 0-37.696 0.448-40 0.832-0.384-10.88-16.512-171.456-15.936-178.368M812.16 308.224c22.848 116.416 40.192 315.328 40.832 328.064 0 0 18.048 0.448 38.336 1.728-11.968-125.44-26.624-325.76-26.368-332.288-5.056-5.696-52.8 2.496-52.8 2.496m-50.24 275.328c-4.416-32.64-121.216-69.76-186.944-57.792 0 0-8.192-72-11.328-141.76a1447.04 1447.04 0 0 1 0.192-127.68c-4.352-3.2-51.712 19.456-77.248 28.864 0 0 30.592 129.408 52.736 397.824 0 0 35.392 3.776 96.128-7.936s132.544-48.384 126.464-91.52m-142.784 58.88l-10.24-73.984c2.496-1.28 65.536 22.208 72.192 26.432-1.024 4.608-61.952 47.488-61.952 47.488m-364.16-251.648c2.56 0.448 22.272-3.968 23.04-2.56 1.28 1.92 10.112 65.152 7.808 65.6-2.304 0.384-18.688 4.16-18.688 4.16-1.28-8.576-11.904-61.76-12.16-67.2m31.424-6.08l8.64 68.032c4.352-0.192 22.144-1.472 23.872-1.664-2.752-25.728-6.912-66.368-6.912-66.368a65.536 65.536 0 0 0-25.6 0M269.44 479.104s38.784-9.856 52.8-5.056c7.104 25.728 20.096 170.24 21.376 176.064-8.832 1.088-37.76 3.584-40 4.224-1.92-10.88-34.176-168.32-34.176-175.232M412.864 392.32c2.304 0.64 22.848-2.112 23.04-0.64 0.448 5.056 2.56 65.792 0.256 65.92l-18.688 1.728c-0.384-8.32-4.8-61.376-4.608-67.008m31.616-1.664l1.728 67.2c4.352 0 21.952 1.024 23.872 0.832-0.448-25.728 0-66.368 0-66.368a129.92 129.92 0 0 0-25.6-1.664m-27.008 90.24s39.616-5.248 52.992 1.024c2.944 30.144 2.56 170.688 2.944 176.512-8.96 0-37.696 0.448-40 0.832-0.192-10.88-16.512-171.456-15.936-178.368M325.568 308.224c22.848 116.416 40.192 315.328 40.832 328.064 0 0 18.048 0.448 38.336 1.728-11.968-125.44-26.624-325.76-26.368-332.544-5.056-5.44-52.8 2.752-52.8 2.752m-50.24 275.328c-4.416-32.64-121.216-69.76-186.944-57.792 0 0-8.192-72-11.328-141.76a1447.04 1447.04 0 0 1 0.192-127.68C72.832 253.376 25.6 275.776 0 285.184c0 0 30.592 129.408 52.736 397.824 0 0 35.392 3.776 96.128-7.936s132.48-48.384 126.464-91.52m-142.784 58.88l-10.24-73.984c2.496-1.28 65.536 22.208 72.192 26.432-1.024 4.608-61.952 47.488-61.952 47.488" fill="#FFFFFF" p-id="10972"></path></svg></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-ff5c4dd3 data-v-ba4558fe data-v-77509512><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-77509512><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="icon" data-v-77509512><circle cx="12" cy="12" r="2"></circle><circle cx="19" cy="12" r="2"></circle><circle cx="5" cy="12" r="2"></circle></svg></button><div class="menu" data-v-77509512><div class="VPMenu" data-v-77509512 data-v-8d8238a7><!----><!--[--><!--[--><!----><div class="group" data-v-ba4558fe><div class="item appearance" data-v-ba4558fe><p class="label" data-v-ba4558fe>外观</p><div class="appearance-action" data-v-ba4558fe><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="toggle dark mode" aria-checked="false" data-v-ba4558fe data-v-799bb6cc data-v-73f5360c><span class="check" data-v-73f5360c><span class="icon" data-v-73f5360c><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-799bb6cc><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-799bb6cc><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></div></div></div><div class="group" data-v-ba4558fe><div class="item social-links" data-v-ba4558fe><div class="VPSocialLinks social-links-list" data-v-ba4558fe data-v-630d9035><!--[--><a class="VPSocialLink no-icon" href="https://github.com/maomao1996/vitepress-nav-template" aria-label="github" target="_blank" rel="noopener" data-v-630d9035 data-v-516a33a1><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><a class="VPSocialLink no-icon" href="https://weixin.qq.com/" aria-label target="_blank" rel="noopener" data-v-630d9035 data-v-516a33a1><svg t="1703841371820" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7872" width="200" height="200"><path d="M683.058 364.695c11 0 22 1.016 32.943 1.976C686.564 230.064 538.896 128 370.681 128c-188.104 0.66-342.237 127.793-342.237 289.226 0 93.068 51.379 169.827 136.725 229.256L130.72 748.43l119.796-59.368c42.918 8.395 77.37 16.79 119.742 16.79 11 0 21.46-0.48 31.914-1.442a259.168 259.168 0 0 1-10.455-71.358c0.485-148.002 128.744-268.297 291.403-268.297l-0.06-0.06z m-184.113-91.992c25.99 0 42.913 16.79 42.913 42.575 0 25.188-16.923 42.579-42.913 42.579-25.45 0-51.38-16.85-51.38-42.58 0-25.784 25.93-42.574 51.38-42.574z m-239.544 85.154c-25.384 0-51.374-16.85-51.374-42.58 0-25.784 25.99-42.574 51.374-42.574 25.45 0 42.918 16.79 42.918 42.575 0 25.188-16.924 42.579-42.918 42.579z m736.155 271.655c0-135.647-136.725-246.527-290.983-246.527-162.655 0-290.918 110.88-290.918 246.527 0 136.128 128.263 246.587 290.918 246.587 33.972 0 68.423-8.395 102.818-16.85l93.809 50.973-25.93-84.677c68.907-51.93 120.286-119.815 120.286-196.033z m-385.275-42.58c-16.923 0-34.452-16.79-34.452-34.179 0-16.79 17.529-34.18 34.452-34.18 25.99 0 42.918 16.85 42.918 34.18 0 17.39-16.928 34.18-42.918 34.18z m188.165 0c-16.984 0-33.972-16.79-33.972-34.179 0-16.79 16.927-34.18 33.972-34.18 25.93 0 42.913 16.85 42.913 34.18 0 17.39-16.983 34.18-42.913 34.18z" fill="#09BB07" p-id="7873"></path></svg></a><a class="VPSocialLink no-icon" href="https://gitee.com/" aria-label target="_blank" rel="noopener" data-v-630d9035 data-v-516a33a1><svg t="1703841714246" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9766" width="200" height="200"><path d="M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z" fill="#C71D23" p-id="9767"></path></svg></a><a class="VPSocialLink no-icon" href="https://www.bilibili.com/" aria-label target="_blank" rel="noopener" data-v-630d9035 data-v-516a33a1><svg t="1703842691600" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10969" width="200" height="200"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#FF6B9B" p-id="10970"></path><path d="M336.896 115.584l117.568 115.968h115.008l117.632-115.904a36.672 36.672 0 0 1 51.328 0 35.456 35.456 0 0 1 0 50.56L672 231.552h75.648c33.664 0 65.92 13.184 89.792 36.672 23.808 23.488 37.12 55.296 37.12 88.512v286.08c0 33.216-13.312 65.024-37.12 88.512a127.872 127.872 0 0 1-89.792 36.672H276.288c-33.664 0-65.92-13.184-89.792-36.672a124.288 124.288 0 0 1-37.12-88.512v-286.08c0-33.216 13.312-65.024 37.12-88.512a127.872 127.872 0 0 1 89.792-36.672h75.584L285.568 166.144a35.456 35.456 0 0 1-9.344-34.56 36.608 36.608 0 0 1 60.736-16z m410.88 187.52H276.224a54.144 54.144 0 0 0-54.144 48.512l-0.256 5.12v286.08c0 27.648 21.248 50.752 49.152 53.44l5.248 0.192h471.424a54.144 54.144 0 0 0 54.144-48.448l0.256-5.12v-286.08a54.016 54.016 0 0 0-54.4-53.76z m-380.8 107.264c19.968 0 36.224 16 36.224 35.776v71.552a36.032 36.032 0 0 1-36.288 35.712 36.032 36.032 0 0 1-36.224-35.712V446.08c0-19.776 16.192-35.776 36.224-35.776z m290.112 0c20.032 0 36.224 16 36.224 35.776v71.552a36.032 36.032 0 0 1-36.224 35.712 36.032 36.032 0 0 1-36.288-35.712V446.08c0-19.776 16.256-35.776 36.288-35.776z" fill="#FF7BA6" p-id="10971"></path><path d="M741.632 390.72c2.496 0.448 22.208-3.968 23.04-2.56 1.28 1.92 10.048 65.152 7.68 65.6-2.24 0.384-18.56 4.16-18.56 4.16-1.28-8.576-11.968-61.76-12.16-67.2m31.36-6.08l8.64 68.032c4.352-0.192 22.144-1.472 23.872-1.664-2.56-25.728-6.912-66.368-6.912-66.368a65.536 65.536 0 0 0-25.6 0m-16.896 94.464s38.72-9.856 52.736-5.056c7.104 25.728 20.096 170.24 21.376 176.064-8.832 1.088-37.76 3.584-40 4.224-1.92-10.88-34.112-168.32-34.112-175.232m143.36-86.72c2.368 0.64 22.848-2.112 23.04-0.64 0.448 5.056 2.56 65.792 0.256 65.92l-18.688 1.728c-0.384-8.32-4.992-61.376-4.544-67.008m31.616-1.664l1.664 67.2c4.352 0 21.952 1.024 23.872 0.832-0.448-25.728 0-66.368 0-66.368a115.712 115.712 0 0 0-25.6-1.664m-27.008 90.24s39.616-5.248 52.992 1.024c2.944 30.144 2.56 170.688 2.944 176.512-8.96 0-37.696 0.448-40 0.832-0.384-10.88-16.512-171.456-15.936-178.368M812.16 308.224c22.848 116.416 40.192 315.328 40.832 328.064 0 0 18.048 0.448 38.336 1.728-11.968-125.44-26.624-325.76-26.368-332.288-5.056-5.696-52.8 2.496-52.8 2.496m-50.24 275.328c-4.416-32.64-121.216-69.76-186.944-57.792 0 0-8.192-72-11.328-141.76a1447.04 1447.04 0 0 1 0.192-127.68c-4.352-3.2-51.712 19.456-77.248 28.864 0 0 30.592 129.408 52.736 397.824 0 0 35.392 3.776 96.128-7.936s132.544-48.384 126.464-91.52m-142.784 58.88l-10.24-73.984c2.496-1.28 65.536 22.208 72.192 26.432-1.024 4.608-61.952 47.488-61.952 47.488m-364.16-251.648c2.56 0.448 22.272-3.968 23.04-2.56 1.28 1.92 10.112 65.152 7.808 65.6-2.304 0.384-18.688 4.16-18.688 4.16-1.28-8.576-11.904-61.76-12.16-67.2m31.424-6.08l8.64 68.032c4.352-0.192 22.144-1.472 23.872-1.664-2.752-25.728-6.912-66.368-6.912-66.368a65.536 65.536 0 0 0-25.6 0M269.44 479.104s38.784-9.856 52.8-5.056c7.104 25.728 20.096 170.24 21.376 176.064-8.832 1.088-37.76 3.584-40 4.224-1.92-10.88-34.176-168.32-34.176-175.232M412.864 392.32c2.304 0.64 22.848-2.112 23.04-0.64 0.448 5.056 2.56 65.792 0.256 65.92l-18.688 1.728c-0.384-8.32-4.8-61.376-4.608-67.008m31.616-1.664l1.728 67.2c4.352 0 21.952 1.024 23.872 0.832-0.448-25.728 0-66.368 0-66.368a129.92 129.92 0 0 0-25.6-1.664m-27.008 90.24s39.616-5.248 52.992 1.024c2.944 30.144 2.56 170.688 2.944 176.512-8.96 0-37.696 0.448-40 0.832-0.192-10.88-16.512-171.456-15.936-178.368M325.568 308.224c22.848 116.416 40.192 315.328 40.832 328.064 0 0 18.048 0.448 38.336 1.728-11.968-125.44-26.624-325.76-26.368-332.544-5.056-5.44-52.8 2.752-52.8 2.752m-50.24 275.328c-4.416-32.64-121.216-69.76-186.944-57.792 0 0-8.192-72-11.328-141.76a1447.04 1447.04 0 0 1 0.192-127.68C72.832 253.376 25.6 275.776 0 285.184c0 0 30.592 129.408 52.736 397.824 0 0 35.392 3.776 96.128-7.936s132.48-48.384 126.464-91.52m-142.784 58.88l-10.24-73.984c2.496-1.28 65.536 22.208 72.192 26.432-1.024 4.608-61.952 47.488-61.952 47.488" fill="#FFFFFF" p-id="10972"></path></svg></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-ff5c4dd3 data-v-0f5c76f7><span class="container" data-v-0f5c76f7><span class="top" data-v-0f5c76f7></span><span class="middle" data-v-0f5c76f7></span><span class="bottom" data-v-0f5c76f7></span></span></button></div></div></div></div><!----></header><div class="VPLocalNav fixed reached-top" data-v-9318537a data-v-25546185><!----><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-25546185 data-v-11ffa2ae><button data-v-11ffa2ae>返回顶部</button><!----></div></div><!----><div class="VPContent" id="VPContent" data-v-9318537a data-v-4dd6dd46><div class="VPDoc has-aside" data-v-4dd6dd46 data-v-42620db0><!--[--><!--]--><div class="container" data-v-42620db0><div class="aside" data-v-42620db0><div class="aside-curtain" data-v-42620db0></div><div class="aside-container" data-v-42620db0><div class="aside-content" data-v-42620db0><div class="VPDocAside" data-v-42620db0 data-v-0770f702><!--[--><!--]--><!--[--><!--]--><div class="VPDocAsideOutline" role="navigation" data-v-0770f702 data-v-41840e04><div class="content" data-v-41840e04><div class="outline-marker" data-v-41840e04></div><div class="outline-title" role="heading" aria-level="2" data-v-41840e04>本页目录</div><nav aria-labelledby="doc-outline-aria-label" data-v-41840e04><span class="visually-hidden" id="doc-outline-aria-label" data-v-41840e04> Table of Contents for current page </span><ul class="root" data-v-41840e04 data-v-50a1839a><!--[--><!--]--></ul></nav></div></div><!--[--><!--]--><div class="spacer" data-v-0770f702></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-42620db0><div class="content-container" data-v-42620db0><!--[--><!--]--><!----><main class="main" data-v-42620db0><div style="position:relative;" class="vp-doc _vitepress_note_public_daily-notes_%E5%AD%97%E7%AC%A6%E4%B8%B2" data-v-42620db0><div><h1 id="简介" tabindex="-1">简介 <a class="header-anchor" href="#简介" aria-label="Permalink to &quot;简介&quot;">​</a></h1><ol><li><p>定义：</p><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 使用单、双引号都可以</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> a </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;hello&#39;</span></span>
<span class="line"><span style="color:#6A737D;">// 外双内单 或者 外单内双</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> b </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&quot;He is called &#39;Johnny&#39;&quot;</span></span>
<span class="line"><span style="color:#6A737D;">// 可以使用索引访问字符串中的某个字符：（字符串索引从0开始）</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> c </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> a[</span><span style="color:#79B8FF;">1</span><span style="color:#E1E4E8;">] </span><span style="color:#6A737D;">// &#39;e&#39;</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 使用单、双引号都可以</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> a </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;hello&#39;</span></span>
<span class="line"><span style="color:#6A737D;">// 外双内单 或者 外单内双</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> b </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&quot;He is called &#39;Johnny&#39;&quot;</span></span>
<span class="line"><span style="color:#6A737D;">// 可以使用索引访问字符串中的某个字符：（字符串索引从0开始）</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> c </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> a[</span><span style="color:#005CC5;">1</span><span style="color:#24292E;">] </span><span style="color:#6A737D;">// &#39;e&#39;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div></li><li><p>字符串长度：<code>a.length</code></p></li><li><p>转义字符 <code>\</code> ：</p><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> y </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;He is called &quot;Johnny&quot;&#39;</span><span style="color:#E1E4E8;"> </span><span style="color:#6A737D;">// He is called &quot;Johnny&quot;</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> y </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;He is called &quot;Johnny&quot;&#39;</span><span style="color:#24292E;"> </span><span style="color:#6A737D;">// He is called &quot;Johnny&quot;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><p><img src="/vitepress_note_public/assets/image-20220525165545236.33ee7ff1.png" alt="image-20220525165545236"></p></li><li><p>转换为字符串类型：</p><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 方法一：toString()</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> a </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">1</span></span>
<span class="line"><span style="color:#E1E4E8;">a </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> a.</span><span style="color:#B392F0;">toString</span><span style="color:#E1E4E8;">() </span><span style="color:#6A737D;">// &#39;1&#39;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">// 方法二：加号拼接</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> a </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">1</span></span>
<span class="line"><span style="color:#E1E4E8;">a </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> a </span><span style="color:#F97583;">+</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;&#39;</span><span style="color:#E1E4E8;"> </span><span style="color:#6A737D;">// &#39;1&#39;</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 方法一：toString()</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> a </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">1</span></span>
<span class="line"><span style="color:#24292E;">a </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> a.</span><span style="color:#6F42C1;">toString</span><span style="color:#24292E;">() </span><span style="color:#6A737D;">// &#39;1&#39;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">// 方法二：加号拼接</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> a </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">1</span></span>
<span class="line"><span style="color:#24292E;">a </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> a </span><span style="color:#D73A49;">+</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;&#39;</span><span style="color:#24292E;"> </span><span style="color:#6A737D;">// &#39;1&#39;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div></li></ol><h1 id="内置方法" tabindex="-1">内置方法 <a class="header-anchor" href="#内置方法" aria-label="Permalink to &quot;内置方法&quot;">​</a></h1><p>==<strong>字符串所有内置方法，都不会修改字符串本身。</strong>==</p><h2 id="indexof" tabindex="-1">==indexOf== <a class="header-anchor" href="#indexof" aria-label="Permalink to &quot;==indexOf==&quot;">​</a></h2><ol><li><p><strong>返回指定 字符/字符串 第一次出现的位置，找不到返回 -1</strong></p></li><li><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 语法：str.indexOf(&#39;要查找的字符/字符串&#39;, [起始查找的位置])</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> aa </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;你好，我叫小明，我喜欢篮球&#39;</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> bb </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;hello world!&#39;</span></span>
<span class="line"><span style="color:#E1E4E8;">console.</span><span style="color:#B392F0;">log</span><span style="color:#E1E4E8;">(aa.</span><span style="color:#B392F0;">indexOf</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;我&#39;</span><span style="color:#E1E4E8;">)) </span><span style="color:#6A737D;">// 3</span></span>
<span class="line"><span style="color:#E1E4E8;">console.</span><span style="color:#B392F0;">log</span><span style="color:#E1E4E8;">(aa.</span><span style="color:#B392F0;">indexOf</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;我&#39;</span><span style="color:#E1E4E8;">, </span><span style="color:#79B8FF;">4</span><span style="color:#E1E4E8;">)) </span><span style="color:#6A737D;">// 从索引号4开始往后找，所以打印8</span></span>
<span class="line"><span style="color:#E1E4E8;">console.</span><span style="color:#B392F0;">log</span><span style="color:#E1E4E8;">(bb.</span><span style="color:#B392F0;">indexOf</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;world&#39;</span><span style="color:#E1E4E8;">)) </span><span style="color:#6A737D;">// 6</span></span>
<span class="line"><span style="color:#E1E4E8;">console.</span><span style="color:#B392F0;">log</span><span style="color:#E1E4E8;">(bb.</span><span style="color:#B392F0;">indexOf</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;k&#39;</span><span style="color:#E1E4E8;">)) </span><span style="color:#6A737D;">// -1</span></span>
<span class="line"><span style="color:#6A737D;">// indexOf 空字符串如果没有空字符串则返回0</span></span>
<span class="line"><span style="color:#E1E4E8;">console.</span><span style="color:#B392F0;">log</span><span style="color:#E1E4E8;">(aa.</span><span style="color:#B392F0;">indexOf</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;&#39;</span><span style="color:#E1E4E8;">)) </span><span style="color:#6A737D;">// 0</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 语法：str.indexOf(&#39;要查找的字符/字符串&#39;, [起始查找的位置])</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> aa </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;你好，我叫小明，我喜欢篮球&#39;</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> bb </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;hello world!&#39;</span></span>
<span class="line"><span style="color:#24292E;">console.</span><span style="color:#6F42C1;">log</span><span style="color:#24292E;">(aa.</span><span style="color:#6F42C1;">indexOf</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;我&#39;</span><span style="color:#24292E;">)) </span><span style="color:#6A737D;">// 3</span></span>
<span class="line"><span style="color:#24292E;">console.</span><span style="color:#6F42C1;">log</span><span style="color:#24292E;">(aa.</span><span style="color:#6F42C1;">indexOf</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;我&#39;</span><span style="color:#24292E;">, </span><span style="color:#005CC5;">4</span><span style="color:#24292E;">)) </span><span style="color:#6A737D;">// 从索引号4开始往后找，所以打印8</span></span>
<span class="line"><span style="color:#24292E;">console.</span><span style="color:#6F42C1;">log</span><span style="color:#24292E;">(bb.</span><span style="color:#6F42C1;">indexOf</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;world&#39;</span><span style="color:#24292E;">)) </span><span style="color:#6A737D;">// 6</span></span>
<span class="line"><span style="color:#24292E;">console.</span><span style="color:#6F42C1;">log</span><span style="color:#24292E;">(bb.</span><span style="color:#6F42C1;">indexOf</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;k&#39;</span><span style="color:#24292E;">)) </span><span style="color:#6A737D;">// -1</span></span>
<span class="line"><span style="color:#6A737D;">// indexOf 空字符串如果没有空字符串则返回0</span></span>
<span class="line"><span style="color:#24292E;">console.</span><span style="color:#6F42C1;">log</span><span style="color:#24292E;">(aa.</span><span style="color:#6F42C1;">indexOf</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;&#39;</span><span style="color:#24292E;">)) </span><span style="color:#6A737D;">// 0</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br></div></div></li><li><p>扩展案例：</p><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 查找某个字符出现的位置以及次数，这里查找字符&#39;l&#39;</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> bb </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;hello world!&#39;</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> n </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">0</span><span style="color:#E1E4E8;"> </span><span style="color:#6A737D;">// 计数</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> index </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> bb.</span><span style="color:#B392F0;">indexOf</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;l&#39;</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// 位置</span></span>
<span class="line"><span style="color:#F97583;">while</span><span style="color:#E1E4E8;"> (index </span><span style="color:#F97583;">!==</span><span style="color:#E1E4E8;"> </span><span style="color:#F97583;">-</span><span style="color:#79B8FF;">1</span><span style="color:#E1E4E8;">) {</span></span>
<span class="line"><span style="color:#E1E4E8;">  console.</span><span style="color:#B392F0;">log</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">`位置：${</span><span style="color:#E1E4E8;">index</span><span style="color:#9ECBFF;">}，第${</span><span style="color:#F97583;">++</span><span style="color:#E1E4E8;">n</span><span style="color:#9ECBFF;">}次出现`</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">  index </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> bb.</span><span style="color:#B392F0;">indexOf</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;l&#39;</span><span style="color:#E1E4E8;">, index </span><span style="color:#F97583;">+</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">1</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">}</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 查找某个字符出现的位置以及次数，这里查找字符&#39;l&#39;</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> bb </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;hello world!&#39;</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> n </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">0</span><span style="color:#24292E;"> </span><span style="color:#6A737D;">// 计数</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> index </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> bb.</span><span style="color:#6F42C1;">indexOf</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;l&#39;</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// 位置</span></span>
<span class="line"><span style="color:#D73A49;">while</span><span style="color:#24292E;"> (index </span><span style="color:#D73A49;">!==</span><span style="color:#24292E;"> </span><span style="color:#D73A49;">-</span><span style="color:#005CC5;">1</span><span style="color:#24292E;">) {</span></span>
<span class="line"><span style="color:#24292E;">  console.</span><span style="color:#6F42C1;">log</span><span style="color:#24292E;">(</span><span style="color:#032F62;">`位置：${</span><span style="color:#24292E;">index</span><span style="color:#032F62;">}，第${</span><span style="color:#D73A49;">++</span><span style="color:#24292E;">n</span><span style="color:#032F62;">}次出现`</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">  index </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> bb.</span><span style="color:#6F42C1;">indexOf</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;l&#39;</span><span style="color:#24292E;">, index </span><span style="color:#D73A49;">+</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">1</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div><p><img src="" alt="image-20220525190118100"></p></li></ol><h2 id="includes" tabindex="-1">includes <a class="header-anchor" href="#includes" aria-label="Permalink to &quot;includes&quot;">​</a></h2><ol><li><p>用于判断字符串是否包含指定的子字符串。</p></li><li><p>包含返回 true ，不包含返回 false</p></li><li><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 语法：string.includes(searchvalue, start)</span></span>
<span class="line"><span style="color:#6A737D;">// 第一个参数是要查找的字符串，必选；第二个参数是设置从哪个位置开始查找，默认为 0，可选。</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> str </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;Hello world, welcome to the Runoob。&#39;</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> n </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">includes</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;Runoob&#39;</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// true</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> n1 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">includes</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;world&#39;</span><span style="color:#E1E4E8;">, </span><span style="color:#79B8FF;">12</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// false</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 语法：string.includes(searchvalue, start)</span></span>
<span class="line"><span style="color:#6A737D;">// 第一个参数是要查找的字符串，必选；第二个参数是设置从哪个位置开始查找，默认为 0，可选。</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> str </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;Hello world, welcome to the Runoob。&#39;</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> n </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">includes</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;Runoob&#39;</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// true</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> n1 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">includes</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;world&#39;</span><span style="color:#24292E;">, </span><span style="color:#005CC5;">12</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// false</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div></li></ol><h2 id="startswith" tabindex="-1">startsWith <a class="header-anchor" href="#startswith" aria-label="Permalink to &quot;startsWith&quot;">​</a></h2><ol><li><p>查看字符串是否以指定的子字符串开头。（区分大小写）</p></li><li><p>是返回 true ，不是返回 false</p></li><li><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 语法：string.startsWith(searchvalue, start)</span></span>
<span class="line"><span style="color:#6A737D;">// 第一个参数是要查找的字符串，必选；第二个参数是查找的开始位置，默认为 0，可选。</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> str </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;Hello world, welcome to the Runoob.&#39;</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> n </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">startsWith</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;Hello&#39;</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// true</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> n1 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">startsWith</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;world&#39;</span><span style="color:#E1E4E8;">, </span><span style="color:#79B8FF;">6</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// true</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 语法：string.startsWith(searchvalue, start)</span></span>
<span class="line"><span style="color:#6A737D;">// 第一个参数是要查找的字符串，必选；第二个参数是查找的开始位置，默认为 0，可选。</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> str </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;Hello world, welcome to the Runoob.&#39;</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> n </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">startsWith</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;Hello&#39;</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// true</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> n1 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">startsWith</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;world&#39;</span><span style="color:#24292E;">, </span><span style="color:#005CC5;">6</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// true</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div></li></ol><h2 id="endswith" tabindex="-1">endsWith <a class="header-anchor" href="#endswith" aria-label="Permalink to &quot;endsWith&quot;">​</a></h2><ol><li><p>查看字符串是否以指定的子字符串结尾。（区分大小写）</p></li><li><p>是返回 true ，不是返回 false</p></li><li><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 语法：string.endsWith(searchvalue, length)</span></span>
<span class="line"><span style="color:#6A737D;">// 第一个参数是要查找的字符串，必选；第二个参数是设置字符串的长度。默认值为原始字符串长度，可选。</span></span>
<span class="line"><span style="color:#6A737D;">// 注：第二个参数与 startsWith 不同</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">let</span><span style="color:#E1E4E8;"> str </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;Hello world&#39;</span></span>
<span class="line"><span style="color:#E1E4E8;">str.</span><span style="color:#B392F0;">endsWith</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;world&#39;</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// 返回 true</span></span>
<span class="line"><span style="color:#E1E4E8;">str.</span><span style="color:#B392F0;">endsWith</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;World&#39;</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// 返回 false</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> str1 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;To be, or not to be, that is the question.&#39;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#E1E4E8;">str1.</span><span style="color:#B392F0;">endsWith</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;question.&#39;</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// true</span></span>
<span class="line"><span style="color:#E1E4E8;">str1.</span><span style="color:#B392F0;">endsWith</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;to be&#39;</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// false</span></span>
<span class="line"><span style="color:#E1E4E8;">str1.</span><span style="color:#B392F0;">endsWith</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;to be&#39;</span><span style="color:#E1E4E8;">, </span><span style="color:#79B8FF;">19</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// true</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 语法：string.endsWith(searchvalue, length)</span></span>
<span class="line"><span style="color:#6A737D;">// 第一个参数是要查找的字符串，必选；第二个参数是设置字符串的长度。默认值为原始字符串长度，可选。</span></span>
<span class="line"><span style="color:#6A737D;">// 注：第二个参数与 startsWith 不同</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">let</span><span style="color:#24292E;"> str </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;Hello world&#39;</span></span>
<span class="line"><span style="color:#24292E;">str.</span><span style="color:#6F42C1;">endsWith</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;world&#39;</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// 返回 true</span></span>
<span class="line"><span style="color:#24292E;">str.</span><span style="color:#6F42C1;">endsWith</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;World&#39;</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// 返回 false</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> str1 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;To be, or not to be, that is the question.&#39;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#24292E;">str1.</span><span style="color:#6F42C1;">endsWith</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;question.&#39;</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// true</span></span>
<span class="line"><span style="color:#24292E;">str1.</span><span style="color:#6F42C1;">endsWith</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;to be&#39;</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// false</span></span>
<span class="line"><span style="color:#24292E;">str1.</span><span style="color:#6F42C1;">endsWith</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;to be&#39;</span><span style="color:#24292E;">, </span><span style="color:#005CC5;">19</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// true</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br></div></div></li></ol><h2 id="charat" tabindex="-1">charAt <a class="header-anchor" href="#charat" aria-label="Permalink to &quot;charAt&quot;">​</a></h2><ol><li><p>返回指定位置的字符。</p></li><li><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> str </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;HELLO WORLD&#39;</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> n </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">charAt</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">1</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// n为E</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> str </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;HELLO WORLD&#39;</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> n </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">charAt</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">1</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// n为E</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div></li><li><p>扩展案例：</p><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 查找字符串里出现次数最多的字符，并统计出现次数</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">// 待检索的字符串</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> cc </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;aabbcccdddd&#39;</span></span>
<span class="line"><span style="color:#6A737D;">// 创建一个空对象存储字符与次数</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> o </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> {}</span></span>
<span class="line"><span style="color:#6A737D;">// 遍历字符串</span></span>
<span class="line"><span style="color:#F97583;">for</span><span style="color:#E1E4E8;"> (</span><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> i </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">0</span><span style="color:#E1E4E8;">; i </span><span style="color:#F97583;">&lt;</span><span style="color:#E1E4E8;"> cc.</span><span style="color:#79B8FF;">length</span><span style="color:#E1E4E8;">; i</span><span style="color:#F97583;">++</span><span style="color:#E1E4E8;">) {</span></span>
<span class="line"><span style="color:#E1E4E8;">  </span><span style="color:#6A737D;">// 拿到每一个字符并存入对象中</span></span>
<span class="line"><span style="color:#E1E4E8;">  </span><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> k </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> cc.</span><span style="color:#B392F0;">charAt</span><span style="color:#E1E4E8;">(i)</span></span>
<span class="line"><span style="color:#E1E4E8;">  </span><span style="color:#F97583;">if</span><span style="color:#E1E4E8;"> (o[k]) {</span></span>
<span class="line"><span style="color:#E1E4E8;">    o[k]</span><span style="color:#F97583;">++</span></span>
<span class="line"><span style="color:#E1E4E8;">  } </span><span style="color:#F97583;">else</span><span style="color:#E1E4E8;"> {</span></span>
<span class="line"><span style="color:#E1E4E8;">    o[k] </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">1</span></span>
<span class="line"><span style="color:#E1E4E8;">  }</span></span>
<span class="line"><span style="color:#E1E4E8;">}</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> max </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">0</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> ch </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;&#39;</span></span>
<span class="line"><span style="color:#F97583;">for</span><span style="color:#E1E4E8;"> (</span><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> y </span><span style="color:#F97583;">in</span><span style="color:#E1E4E8;"> o) {</span></span>
<span class="line"><span style="color:#E1E4E8;">  </span><span style="color:#6A737D;">// y得到属性名，o[y]得到属性值</span></span>
<span class="line"><span style="color:#E1E4E8;">  </span><span style="color:#F97583;">if</span><span style="color:#E1E4E8;"> (o[y] </span><span style="color:#F97583;">&gt;</span><span style="color:#E1E4E8;"> max) {</span></span>
<span class="line"><span style="color:#E1E4E8;">    max </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> o[y]</span></span>
<span class="line"><span style="color:#E1E4E8;">    ch </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> y</span></span>
<span class="line"><span style="color:#E1E4E8;">  }</span></span>
<span class="line"><span style="color:#E1E4E8;">}</span></span>
<span class="line"><span style="color:#E1E4E8;">console.</span><span style="color:#B392F0;">log</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">`出现最多的字符是${</span><span style="color:#E1E4E8;">ch</span><span style="color:#9ECBFF;">}，总共${</span><span style="color:#E1E4E8;">max</span><span style="color:#9ECBFF;">}次`</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// 出现最多的字符是d，总共4次</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 查找字符串里出现次数最多的字符，并统计出现次数</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">// 待检索的字符串</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> cc </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;aabbcccdddd&#39;</span></span>
<span class="line"><span style="color:#6A737D;">// 创建一个空对象存储字符与次数</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> o </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> {}</span></span>
<span class="line"><span style="color:#6A737D;">// 遍历字符串</span></span>
<span class="line"><span style="color:#D73A49;">for</span><span style="color:#24292E;"> (</span><span style="color:#D73A49;">var</span><span style="color:#24292E;"> i </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">0</span><span style="color:#24292E;">; i </span><span style="color:#D73A49;">&lt;</span><span style="color:#24292E;"> cc.</span><span style="color:#005CC5;">length</span><span style="color:#24292E;">; i</span><span style="color:#D73A49;">++</span><span style="color:#24292E;">) {</span></span>
<span class="line"><span style="color:#24292E;">  </span><span style="color:#6A737D;">// 拿到每一个字符并存入对象中</span></span>
<span class="line"><span style="color:#24292E;">  </span><span style="color:#D73A49;">var</span><span style="color:#24292E;"> k </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> cc.</span><span style="color:#6F42C1;">charAt</span><span style="color:#24292E;">(i)</span></span>
<span class="line"><span style="color:#24292E;">  </span><span style="color:#D73A49;">if</span><span style="color:#24292E;"> (o[k]) {</span></span>
<span class="line"><span style="color:#24292E;">    o[k]</span><span style="color:#D73A49;">++</span></span>
<span class="line"><span style="color:#24292E;">  } </span><span style="color:#D73A49;">else</span><span style="color:#24292E;"> {</span></span>
<span class="line"><span style="color:#24292E;">    o[k] </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">1</span></span>
<span class="line"><span style="color:#24292E;">  }</span></span>
<span class="line"><span style="color:#24292E;">}</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> max </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">0</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> ch </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;&#39;</span></span>
<span class="line"><span style="color:#D73A49;">for</span><span style="color:#24292E;"> (</span><span style="color:#D73A49;">var</span><span style="color:#24292E;"> y </span><span style="color:#D73A49;">in</span><span style="color:#24292E;"> o) {</span></span>
<span class="line"><span style="color:#24292E;">  </span><span style="color:#6A737D;">// y得到属性名，o[y]得到属性值</span></span>
<span class="line"><span style="color:#24292E;">  </span><span style="color:#D73A49;">if</span><span style="color:#24292E;"> (o[y] </span><span style="color:#D73A49;">&gt;</span><span style="color:#24292E;"> max) {</span></span>
<span class="line"><span style="color:#24292E;">    max </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> o[y]</span></span>
<span class="line"><span style="color:#24292E;">    ch </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> y</span></span>
<span class="line"><span style="color:#24292E;">  }</span></span>
<span class="line"><span style="color:#24292E;">}</span></span>
<span class="line"><span style="color:#24292E;">console.</span><span style="color:#6F42C1;">log</span><span style="color:#24292E;">(</span><span style="color:#032F62;">`出现最多的字符是${</span><span style="color:#24292E;">ch</span><span style="color:#032F62;">}，总共${</span><span style="color:#24292E;">max</span><span style="color:#032F62;">}次`</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// 出现最多的字符是d，总共4次</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br></div></div></li></ol><h2 id="substr" tabindex="-1">==substr== <a class="header-anchor" href="#substr" aria-label="Permalink to &quot;==substr==&quot;">​</a></h2><ol><li><p>可在字符串中抽取从 <em>开始</em> 下标开始的指定数目的字符。<strong>（指定长度提取）</strong></p></li><li><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 语法：string.substr(start,length)</span></span>
<span class="line"><span style="color:#6A737D;">// length 参数为可选</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> str </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;Hello world!&#39;</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> n </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">substr</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">2</span><span style="color:#E1E4E8;">, </span><span style="color:#79B8FF;">3</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// llo</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> m </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">substr</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">2</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// llo world!</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 语法：string.substr(start,length)</span></span>
<span class="line"><span style="color:#6A737D;">// length 参数为可选</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> str </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;Hello world!&#39;</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> n </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">substr</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">2</span><span style="color:#24292E;">, </span><span style="color:#005CC5;">3</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// llo</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> m </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">substr</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">2</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// llo world!</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div></li></ol><h2 id="slice" tabindex="-1">==slice== <a class="header-anchor" href="#slice" aria-label="Permalink to &quot;==slice==&quot;">​</a></h2><ol><li><p><code>string.slice(start,end) </code> 方法可提取字符串的某个部分，并以新的字符串返回被提取的部分。<strong>（指定区间提取）</strong></p></li><li><p><strong>end 为可选，并且不包含 end（即：[ start, end) ）</strong></p></li><li><p><strong>如果是负数，表示从尾部算起。例如：-1 指字符串的最后一个字符的位置，-2 指倒数第二个字符，以此类推。</strong></p></li><li><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> str </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;Hello world!&#39;</span></span>
<span class="line"><span style="color:#6A737D;">// 指定区间，包含第3但 不包含第8位</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> a </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">slice</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">3</span><span style="color:#E1E4E8;">, </span><span style="color:#79B8FF;">8</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// lo wo</span></span>
<span class="line"><span style="color:#6A737D;">// end 可选</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> b </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">slice</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">3</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// lo world!</span></span>
<span class="line"><span style="color:#6A737D;">// 负数</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> n </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">slice</span><span style="color:#E1E4E8;">(</span><span style="color:#F97583;">-</span><span style="color:#79B8FF;">1</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// !</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> n2 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">slice</span><span style="color:#E1E4E8;">(</span><span style="color:#F97583;">-</span><span style="color:#79B8FF;">2</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// d!</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> str </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;Hello world!&#39;</span></span>
<span class="line"><span style="color:#6A737D;">// 指定区间，包含第3但 不包含第8位</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> a </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">slice</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">3</span><span style="color:#24292E;">, </span><span style="color:#005CC5;">8</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// lo wo</span></span>
<span class="line"><span style="color:#6A737D;">// end 可选</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> b </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">slice</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">3</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// lo world!</span></span>
<span class="line"><span style="color:#6A737D;">// 负数</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> n </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">slice</span><span style="color:#24292E;">(</span><span style="color:#D73A49;">-</span><span style="color:#005CC5;">1</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// !</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> n2 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">slice</span><span style="color:#24292E;">(</span><span style="color:#D73A49;">-</span><span style="color:#005CC5;">2</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// d!</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div></li></ol><h2 id="split" tabindex="-1">==split== <a class="header-anchor" href="#split" aria-label="Permalink to &quot;==split==&quot;">​</a></h2><ol><li><p><strong>用于把一个 字符串 分割成 字符串数组。</strong></p></li><li><p><strong>返回值是一个数组</strong></p></li><li><p><strong>如果把空字符串作为分割依据，则会分割每个字符</strong></p></li><li><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 语法：string.split(&#39;分割依据&#39;,指定返回的数组的最大长度)</span></span>
<span class="line"><span style="color:#6A737D;">// 两个参数都是可选的，一般用第一个参数即可</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> str </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;How are you doing today?&#39;</span></span>
<span class="line"><span style="color:#6A737D;">// 以空格进行分割</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> f1 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">split</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39; &#39;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">console.</span><span style="color:#B392F0;">log</span><span style="color:#E1E4E8;">(f1) </span><span style="color:#6A737D;">// [&#39;How&#39;, &#39;are&#39;, &#39;you&#39;, &#39;doing&#39;, &#39;today?&#39;]</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">// 以某字符进行分割</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> f5 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">split</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;o&#39;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">console.</span><span style="color:#B392F0;">log</span><span style="color:#E1E4E8;">(f5) </span><span style="color:#6A737D;">// [&#39;H&#39;, &#39;w are y&#39;, &#39;u d&#39;, &#39;ing t&#39;, &#39;day?&#39;]</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">// 省略分割依据</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> f2 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">split</span><span style="color:#E1E4E8;">()</span></span>
<span class="line"><span style="color:#E1E4E8;">console.</span><span style="color:#B392F0;">log</span><span style="color:#E1E4E8;">(f2) </span><span style="color:#6A737D;">// [&#39;How are you doing today?&#39;]</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">// 以空字符串作为分割依据</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> f3 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">split</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;&#39;</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">console.</span><span style="color:#B392F0;">log</span><span style="color:#E1E4E8;">(f3) </span><span style="color:#6A737D;">// [&#39;H&#39;, &#39;o&#39;, &#39;w&#39;, &#39; &#39;, &#39;a&#39;, &#39;r&#39;, &#39;e&#39;, &#39; &#39;, &#39;y&#39;, &#39;o&#39;, &#39;u&#39;, &#39; &#39;, &#39;d&#39;, &#39;o&#39;, &#39;i&#39;, &#39;n&#39;, &#39;g&#39;, &#39; &#39;, &#39;t&#39;, &#39;o&#39;, &#39;d&#39;, &#39;a&#39;, &#39;y&#39;, &#39;?&#39;]</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">// 指定返回数组最大长度</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> f4 </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">split</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39; &#39;</span><span style="color:#E1E4E8;">, </span><span style="color:#79B8FF;">3</span><span style="color:#E1E4E8;">)</span></span>
<span class="line"><span style="color:#E1E4E8;">console.</span><span style="color:#B392F0;">log</span><span style="color:#E1E4E8;">(f4) </span><span style="color:#6A737D;">// [&#39;How&#39;, &#39;are&#39;, &#39;you&#39;]</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 语法：string.split(&#39;分割依据&#39;,指定返回的数组的最大长度)</span></span>
<span class="line"><span style="color:#6A737D;">// 两个参数都是可选的，一般用第一个参数即可</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> str </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;How are you doing today?&#39;</span></span>
<span class="line"><span style="color:#6A737D;">// 以空格进行分割</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> f1 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">split</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39; &#39;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">console.</span><span style="color:#6F42C1;">log</span><span style="color:#24292E;">(f1) </span><span style="color:#6A737D;">// [&#39;How&#39;, &#39;are&#39;, &#39;you&#39;, &#39;doing&#39;, &#39;today?&#39;]</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">// 以某字符进行分割</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> f5 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">split</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;o&#39;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">console.</span><span style="color:#6F42C1;">log</span><span style="color:#24292E;">(f5) </span><span style="color:#6A737D;">// [&#39;H&#39;, &#39;w are y&#39;, &#39;u d&#39;, &#39;ing t&#39;, &#39;day?&#39;]</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">// 省略分割依据</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> f2 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">split</span><span style="color:#24292E;">()</span></span>
<span class="line"><span style="color:#24292E;">console.</span><span style="color:#6F42C1;">log</span><span style="color:#24292E;">(f2) </span><span style="color:#6A737D;">// [&#39;How are you doing today?&#39;]</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">// 以空字符串作为分割依据</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> f3 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">split</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;&#39;</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">console.</span><span style="color:#6F42C1;">log</span><span style="color:#24292E;">(f3) </span><span style="color:#6A737D;">// [&#39;H&#39;, &#39;o&#39;, &#39;w&#39;, &#39; &#39;, &#39;a&#39;, &#39;r&#39;, &#39;e&#39;, &#39; &#39;, &#39;y&#39;, &#39;o&#39;, &#39;u&#39;, &#39; &#39;, &#39;d&#39;, &#39;o&#39;, &#39;i&#39;, &#39;n&#39;, &#39;g&#39;, &#39; &#39;, &#39;t&#39;, &#39;o&#39;, &#39;d&#39;, &#39;a&#39;, &#39;y&#39;, &#39;?&#39;]</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A737D;">// 指定返回数组最大长度</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> f4 </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">split</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39; &#39;</span><span style="color:#24292E;">, </span><span style="color:#005CC5;">3</span><span style="color:#24292E;">)</span></span>
<span class="line"><span style="color:#24292E;">console.</span><span style="color:#6F42C1;">log</span><span style="color:#24292E;">(f4) </span><span style="color:#6A737D;">// [&#39;How&#39;, &#39;are&#39;, &#39;you&#39;]</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br></div></div></li></ol><h2 id="repeat" tabindex="-1">repeat <a class="header-anchor" href="#repeat" aria-label="Permalink to &quot;repeat&quot;">​</a></h2><ol><li><p>复制字符串指定次数，并将它们连接在一起返回。</p></li><li><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 语法：string.repeat(count)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> str </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;Runoob&#39;</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> n </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">repeat</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">2</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// RunoobRunoob</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 语法：string.repeat(count)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> str </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;Runoob&#39;</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> n </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">repeat</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">2</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// RunoobRunoob</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div></li></ol><h2 id="replace" tabindex="-1">==replace== <a class="header-anchor" href="#replace" aria-label="Permalink to &quot;==replace==&quot;">​</a></h2><ol><li><p>替换字符串</p></li><li><p>只替换第一个</p></li><li><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 语法：string.replace(searchvalue,newvalue)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> str </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;Visit Microsoft! Visit Microsoft!&#39;</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> n </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">replace</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">&#39;Microsoft&#39;</span><span style="color:#E1E4E8;">, </span><span style="color:#9ECBFF;">&#39;Runoob&#39;</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// Visit Runoob!Visit Microsoft!</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 语法：string.replace(searchvalue,newvalue)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> str </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;Visit Microsoft! Visit Microsoft!&#39;</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> n </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">replace</span><span style="color:#24292E;">(</span><span style="color:#032F62;">&#39;Microsoft&#39;</span><span style="color:#24292E;">, </span><span style="color:#032F62;">&#39;Runoob&#39;</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// Visit Runoob!Visit Microsoft!</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div></li></ol><h2 id="trim" tabindex="-1">trim <a class="header-anchor" href="#trim" aria-label="Permalink to &quot;trim&quot;">​</a></h2><ol><li><p>用于去除字符串头尾的空白</p></li><li><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 语法：string.trim()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> str </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;   nihao  &#39;</span></span>
<span class="line"><span style="color:#B392F0;">alert</span><span style="color:#E1E4E8;">(str.</span><span style="color:#B392F0;">trim</span><span style="color:#E1E4E8;">()) </span><span style="color:#6A737D;">// 弹出&#39;nihao&#39;</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 语法：string.trim()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> str </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;   nihao  &#39;</span></span>
<span class="line"><span style="color:#6F42C1;">alert</span><span style="color:#24292E;">(str.</span><span style="color:#6F42C1;">trim</span><span style="color:#24292E;">()) </span><span style="color:#6A737D;">// 弹出&#39;nihao&#39;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div></li></ol><h2 id="touppercase" tabindex="-1">==toUpperCase== <a class="header-anchor" href="#touppercase" aria-label="Permalink to &quot;==toUpperCase==&quot;">​</a></h2><ol><li><p><strong>用于把字符串转换为大写。</strong></p></li><li><p>不影响原字符串</p></li><li><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 语法：string.toUpperCase()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> str </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;hello&#39;</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> n </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">toUpperCase</span><span style="color:#E1E4E8;">() </span><span style="color:#6A737D;">// HELLO</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 语法：string.toUpperCase()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> str </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;hello&#39;</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> n </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">toUpperCase</span><span style="color:#24292E;">() </span><span style="color:#6A737D;">// HELLO</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div></li></ol><h2 id="tolowercase" tabindex="-1">==toLowerCase== <a class="header-anchor" href="#tolowercase" aria-label="Permalink to &quot;==toLowerCase==&quot;">​</a></h2><ol><li><p><strong>用于把字符串转换为小写。</strong></p></li><li><p>不影响原字符串</p></li><li><div class="language-js vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#6A737D;">// 语法：string.toLowerCase()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> str </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&#39;HelLO&#39;</span></span>
<span class="line"><span style="color:#F97583;">var</span><span style="color:#E1E4E8;"> n </span><span style="color:#F97583;">=</span><span style="color:#E1E4E8;"> str.</span><span style="color:#B392F0;">toLowerCase</span><span style="color:#E1E4E8;">() </span><span style="color:#6A737D;">// hello</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6A737D;">// 语法：string.toLowerCase()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> str </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&#39;HelLO&#39;</span></span>
<span class="line"><span style="color:#D73A49;">var</span><span style="color:#24292E;"> n </span><span style="color:#D73A49;">=</span><span style="color:#24292E;"> str.</span><span style="color:#6F42C1;">toLowerCase</span><span style="color:#24292E;">() </span><span style="color:#6A737D;">// hello</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div></li></ol><h2 id="简单对比" tabindex="-1">简单对比 <a class="header-anchor" href="#简单对比" aria-label="Permalink to &quot;简单对比&quot;">​</a></h2><table><thead><tr><th>内置方法</th><th>描述</th><th>返回值</th></tr></thead><tbody><tr><td>==indexOf==</td><td>查找字符（串）</td><td>字符（串）所在的位置，找不到返回 -1</td></tr><tr><td>includes</td><td>查找是否包含指定字符串</td><td>布尔值</td></tr><tr><td>startsWith</td><td>检查字符串是否以指定字符串开头</td><td>布尔值</td></tr><tr><td>endsWith</td><td>检查字符串是否以指定字符串结尾</td><td>布尔值</td></tr><tr><td>charAt</td><td>指定位置提取（单个）</td><td>提取的字符</td></tr><tr><td>==substr==</td><td>指定长度提取</td><td>提取的字符（串）</td></tr><tr><td>==slice==</td><td>指定区间提取</td><td>提取的字符（串）</td></tr><tr><td>==split==</td><td>把字符串分割成数组</td><td>（分割好的）数组</td></tr><tr><td>repeat</td><td>复制并拼接字符串</td><td>字符串</td></tr><tr><td>==replace==</td><td>替换字符串</td><td>替换之后的字符串</td></tr><tr><td>trim</td><td>去除字符串头尾空白</td><td>去掉头尾空白后的字符串</td></tr><tr><td>==toUpperCase==</td><td>把字符串转换为大写</td><td>转换之后的字符串</td></tr><tr><td>==toLowerCase==</td><td>把字符串转换为小写</td><td>转换之后的字符串</td></tr></tbody></table><h2 id="更多内置方法与用法" tabindex="-1">更多内置方法与用法 <a class="header-anchor" href="#更多内置方法与用法" aria-label="Permalink to &quot;更多内置方法与用法&quot;">​</a></h2><p><a href="https://www.runoob.com/jsref/jsref-obj-string.html" target="_blank" rel="noreferrer">https://www.runoob.com/jsref/jsref-obj-string.html</a></p></div></div></main><footer class="VPDocFooter" data-v-42620db0 data-v-c7f3a203><!--[--><!--]--><!----><!----></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter" data-v-9318537a data-v-6e61ade4><div class="container" data-v-6e61ade4><p class="message" data-v-6e61ade4>根据 MIT 许可证发布</p><p class="copyright" data-v-6e61ade4>Copyright (c) 2024 xiaobinxiaoxiong</p></div></footer><!--[--><!--]--></div></div>
    <script>window.__VP_HASH_MAP__=JSON.parse("{\"index.md\":\"e0dee572\",\"nav_index.md\":\"a9a25e99\",\"daily-notes_字符串.md\":\"2d5c7bf1\",\"daily-notes_数组.md\":\"ca3d7d97\",\"note_web_vue3_vue3快速上手.md\":\"03582f9a\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"小盐菌\",\"description\":\"包含前端常用知识、源码阅读笔记、各种奇淫技巧、日常提效工具等\",\"base\":\"/vitepress_note_public/\",\"head\":[],\"appearance\":true,\"themeConfig\":{\"i18nRouting\":false,\"logo\":\"/logo.png\",\"nav\":[{\"text\":\"首页\",\"link\":\"/\"},{\"text\":\"待开发\",\"link\":\"/nav/\"},{\"text\":\"待开发\",\"link\":\"https://notes.fe-mm.com\"},{\"text\":\"待开发\",\"link\":\"https://netease-music.fe-mm.com\"},{\"text\":\"待开发\",\"link\":\"https://github.com/maomao1996/tampermonkey-scripts\"}],\"sidebar\":{},\"outline\":{\"level\":\"deep\",\"label\":\"本页目录\"},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/maomao1996/vitepress-nav-template\"},{\"icon\":{\"svg\":\"<svg t=\\\"1703841371820\\\" class=\\\"icon\\\" viewBox=\\\"0 0 1024 1024\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" p-id=\\\"7872\\\" width=\\\"200\\\" height=\\\"200\\\"><path d=\\\"M683.058 364.695c11 0 22 1.016 32.943 1.976C686.564 230.064 538.896 128 370.681 128c-188.104 0.66-342.237 127.793-342.237 289.226 0 93.068 51.379 169.827 136.725 229.256L130.72 748.43l119.796-59.368c42.918 8.395 77.37 16.79 119.742 16.79 11 0 21.46-0.48 31.914-1.442a259.168 259.168 0 0 1-10.455-71.358c0.485-148.002 128.744-268.297 291.403-268.297l-0.06-0.06z m-184.113-91.992c25.99 0 42.913 16.79 42.913 42.575 0 25.188-16.923 42.579-42.913 42.579-25.45 0-51.38-16.85-51.38-42.58 0-25.784 25.93-42.574 51.38-42.574z m-239.544 85.154c-25.384 0-51.374-16.85-51.374-42.58 0-25.784 25.99-42.574 51.374-42.574 25.45 0 42.918 16.79 42.918 42.575 0 25.188-16.924 42.579-42.918 42.579z m736.155 271.655c0-135.647-136.725-246.527-290.983-246.527-162.655 0-290.918 110.88-290.918 246.527 0 136.128 128.263 246.587 290.918 246.587 33.972 0 68.423-8.395 102.818-16.85l93.809 50.973-25.93-84.677c68.907-51.93 120.286-119.815 120.286-196.033z m-385.275-42.58c-16.923 0-34.452-16.79-34.452-34.179 0-16.79 17.529-34.18 34.452-34.18 25.99 0 42.918 16.85 42.918 34.18 0 17.39-16.928 34.18-42.918 34.18z m188.165 0c-16.984 0-33.972-16.79-33.972-34.179 0-16.79 16.927-34.18 33.972-34.18 25.93 0 42.913 16.85 42.913 34.18 0 17.39-16.983 34.18-42.913 34.18z\\\" fill=\\\"#09BB07\\\" p-id=\\\"7873\\\"></path></svg>\"},\"link\":\"https://weixin.qq.com/\"},{\"icon\":{\"svg\":\"<svg t=\\\"1703841714246\\\" class=\\\"icon\\\" viewBox=\\\"0 0 1024 1024\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" p-id=\\\"9766\\\" width=\\\"200\\\" height=\\\"200\\\"><path d=\\\"M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z\\\" fill=\\\"#C71D23\\\" p-id=\\\"9767\\\"></path></svg>\"},\"link\":\"https://gitee.com/\"},{\"icon\":{\"svg\":\"<svg t=\\\"1703842691600\\\" class=\\\"icon\\\" viewBox=\\\"0 0 1024 1024\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" p-id=\\\"10969\\\" width=\\\"200\\\" height=\\\"200\\\"><path d=\\\"M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z\\\" fill=\\\"#FF6B9B\\\" p-id=\\\"10970\\\"></path><path d=\\\"M336.896 115.584l117.568 115.968h115.008l117.632-115.904a36.672 36.672 0 0 1 51.328 0 35.456 35.456 0 0 1 0 50.56L672 231.552h75.648c33.664 0 65.92 13.184 89.792 36.672 23.808 23.488 37.12 55.296 37.12 88.512v286.08c0 33.216-13.312 65.024-37.12 88.512a127.872 127.872 0 0 1-89.792 36.672H276.288c-33.664 0-65.92-13.184-89.792-36.672a124.288 124.288 0 0 1-37.12-88.512v-286.08c0-33.216 13.312-65.024 37.12-88.512a127.872 127.872 0 0 1 89.792-36.672h75.584L285.568 166.144a35.456 35.456 0 0 1-9.344-34.56 36.608 36.608 0 0 1 60.736-16z m410.88 187.52H276.224a54.144 54.144 0 0 0-54.144 48.512l-0.256 5.12v286.08c0 27.648 21.248 50.752 49.152 53.44l5.248 0.192h471.424a54.144 54.144 0 0 0 54.144-48.448l0.256-5.12v-286.08a54.016 54.016 0 0 0-54.4-53.76z m-380.8 107.264c19.968 0 36.224 16 36.224 35.776v71.552a36.032 36.032 0 0 1-36.288 35.712 36.032 36.032 0 0 1-36.224-35.712V446.08c0-19.776 16.192-35.776 36.224-35.776z m290.112 0c20.032 0 36.224 16 36.224 35.776v71.552a36.032 36.032 0 0 1-36.224 35.712 36.032 36.032 0 0 1-36.288-35.712V446.08c0-19.776 16.256-35.776 36.288-35.776z\\\" fill=\\\"#FF7BA6\\\" p-id=\\\"10971\\\"></path><path d=\\\"M741.632 390.72c2.496 0.448 22.208-3.968 23.04-2.56 1.28 1.92 10.048 65.152 7.68 65.6-2.24 0.384-18.56 4.16-18.56 4.16-1.28-8.576-11.968-61.76-12.16-67.2m31.36-6.08l8.64 68.032c4.352-0.192 22.144-1.472 23.872-1.664-2.56-25.728-6.912-66.368-6.912-66.368a65.536 65.536 0 0 0-25.6 0m-16.896 94.464s38.72-9.856 52.736-5.056c7.104 25.728 20.096 170.24 21.376 176.064-8.832 1.088-37.76 3.584-40 4.224-1.92-10.88-34.112-168.32-34.112-175.232m143.36-86.72c2.368 0.64 22.848-2.112 23.04-0.64 0.448 5.056 2.56 65.792 0.256 65.92l-18.688 1.728c-0.384-8.32-4.992-61.376-4.544-67.008m31.616-1.664l1.664 67.2c4.352 0 21.952 1.024 23.872 0.832-0.448-25.728 0-66.368 0-66.368a115.712 115.712 0 0 0-25.6-1.664m-27.008 90.24s39.616-5.248 52.992 1.024c2.944 30.144 2.56 170.688 2.944 176.512-8.96 0-37.696 0.448-40 0.832-0.384-10.88-16.512-171.456-15.936-178.368M812.16 308.224c22.848 116.416 40.192 315.328 40.832 328.064 0 0 18.048 0.448 38.336 1.728-11.968-125.44-26.624-325.76-26.368-332.288-5.056-5.696-52.8 2.496-52.8 2.496m-50.24 275.328c-4.416-32.64-121.216-69.76-186.944-57.792 0 0-8.192-72-11.328-141.76a1447.04 1447.04 0 0 1 0.192-127.68c-4.352-3.2-51.712 19.456-77.248 28.864 0 0 30.592 129.408 52.736 397.824 0 0 35.392 3.776 96.128-7.936s132.544-48.384 126.464-91.52m-142.784 58.88l-10.24-73.984c2.496-1.28 65.536 22.208 72.192 26.432-1.024 4.608-61.952 47.488-61.952 47.488m-364.16-251.648c2.56 0.448 22.272-3.968 23.04-2.56 1.28 1.92 10.112 65.152 7.808 65.6-2.304 0.384-18.688 4.16-18.688 4.16-1.28-8.576-11.904-61.76-12.16-67.2m31.424-6.08l8.64 68.032c4.352-0.192 22.144-1.472 23.872-1.664-2.752-25.728-6.912-66.368-6.912-66.368a65.536 65.536 0 0 0-25.6 0M269.44 479.104s38.784-9.856 52.8-5.056c7.104 25.728 20.096 170.24 21.376 176.064-8.832 1.088-37.76 3.584-40 4.224-1.92-10.88-34.176-168.32-34.176-175.232M412.864 392.32c2.304 0.64 22.848-2.112 23.04-0.64 0.448 5.056 2.56 65.792 0.256 65.92l-18.688 1.728c-0.384-8.32-4.8-61.376-4.608-67.008m31.616-1.664l1.728 67.2c4.352 0 21.952 1.024 23.872 0.832-0.448-25.728 0-66.368 0-66.368a129.92 129.92 0 0 0-25.6-1.664m-27.008 90.24s39.616-5.248 52.992 1.024c2.944 30.144 2.56 170.688 2.944 176.512-8.96 0-37.696 0.448-40 0.832-0.192-10.88-16.512-171.456-15.936-178.368M325.568 308.224c22.848 116.416 40.192 315.328 40.832 328.064 0 0 18.048 0.448 38.336 1.728-11.968-125.44-26.624-325.76-26.368-332.544-5.056-5.44-52.8 2.752-52.8 2.752m-50.24 275.328c-4.416-32.64-121.216-69.76-186.944-57.792 0 0-8.192-72-11.328-141.76a1447.04 1447.04 0 0 1 0.192-127.68C72.832 253.376 25.6 275.776 0 285.184c0 0 30.592 129.408 52.736 397.824 0 0 35.392 3.776 96.128-7.936s132.48-48.384 126.464-91.52m-142.784 58.88l-10.24-73.984c2.496-1.28 65.536 22.208 72.192 26.432-1.024 4.608-61.952 47.488-61.952 47.488\\\" fill=\\\"#FFFFFF\\\" p-id=\\\"10972\\\"></path></svg>\"},\"link\":\"https://www.bilibili.com/\"}],\"footer\":{\"message\":\"根据 MIT 许可证发布\",\"copyright\":\"Copyright (c) 2024 xiaobinxiaoxiong\"},\"darkModeSwitchLabel\":\"外观\",\"returnToTopLabel\":\"返回顶部\",\"lastUpdatedText\":\"上次更新\",\"docFooter\":{\"prev\":\"上一篇\",\"next\":\"下一篇\"}},\"locales\":{},\"scrollOffset\":90,\"cleanUrls\":true}");</script>
    
  </body>
</html>